package cn.lan.scau_hotel_service.repository;

import cn.lan.scau_hotel_service.entity.Room;
import cn.lan.scau_hotel_service.entity.RoomType;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface RoomRepository extends JpaRepository<Room,Integer> {

    Room getRoomById(int id);

    int deleteRoomById(int id);

    int countByCanRentTrue();
    int countByRentTrue();

    int countByCanRentTrueAndRentFalse();

    int countByRoomTypeAndCanRentTrueAndRentFalse(RoomType roomType);

    List<Room> findRoomsByCanRentTrueAndRentFalse();

    List<Room> findRoomsByCanRentTrue();

    List<Room> getRoomsByRoomTypeAndCanRentTrueAndRentFalse(RoomType roomType);

    List<Room> findRoomsByRentTrue();

//    List<Room> findAll();
}
